from OCC.Extend.DataExchange import read_step_file, write_step_file
from OCC.Core.gp import gp_Ax2, gp_Pnt, gp_Ax1, gp_Dir, gp_Circ, gp_Elips,gp_Trsf, gp_Vec, gp_Pln
from OCC.Display.SimpleGui import init_display
import wx
from OCC.Extend.DataExchange import *
from OCC.Extend.TopologyUtils import *
from OCC.Extend.ShapeFactory import *
from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox, BRepPrimAPI_MakeCylinder
from OCC.Core.BRepMesh import BRepMesh_IncrementalMesh

Air_shape = read_step_file("data_stp/Air_H.stp")
Pillar_shape = read_step_file("data_stp/Pillar_250.stp")
L_shape = read_step_file("data_stp/L.stp")

def make_box_of_point_axis(corner_point, axis, dx, dy, dz):
    box = BRepPrimAPI_MakeBox(gp_Ax2(gp_Pnt(corner_point[0], corner_point[1], corner_point[2]), 
                              gp_Dir(axis[0], axis[1], axis[2])), dx, dy, dz).Shape()
    return box

corner_point = [2100, -742, 837.5]
axis = [0, 0, 1] 
dx = 60
dy = 40
dz = 30

box1 = make_box_of_point_axis(corner_point, axis, dx, dy, dz)

write_step_file(box1, "data_stp/face_temp.stp", application_protocol="AP203")

display, start_display, add_menu, add_function_to_menu = init_display("wx")
display.DisplayShape([box1], update=True, transparency=0)
start_display()